// owner-menu-item
const { OWNER_MENU_TYPE } = require('../../constants/types');
const { BaseBehavior, COMPONENT_OPTIONS } = require('../../mixins/component');
const { navTo } = require('../../common/platform');
const { OWNER_NAV } = require('../../constants/route');

Component({
    behaviors: [BaseBehavior],
    options: {
        ...COMPONENT_OPTIONS,
    },
    properties: {
        menuInfo: {
            type: Object,
            value: {},
        },
    },
    data: {

    },
    methods: {
        gotoMenuPage() {
            const { menuInfo } = this.data;
            if (menuInfo.type === OWNER_MENU_TYPE.service) {
                this.triggerEvent('contactAction');
            } else {
                navTo(OWNER_NAV[menuInfo.navType]);
            }
        },
    }
})
